
export interface LoginParams {
  account: string
  cipher: string
}

export function loginApi(params: LoginParams) {
  // 后端接口为 formdata，使用 multipart/form-data 提交
  const form = new FormData()
  form.append('account', params.account)
  form.append('cipher', params.cipher)
  return usePost(`/login`, form, {
    loading: true,
    headers: {
      'Content-Type': 'multipart/form-data',
    },
  })
}

export function logoutApi() {
  return useGet('/logout')
}
